/*
 * Copyright (c) 2019.11，华乘电气科技有限公司
 * All rights reserved.
 *
 * 文件名称：spectrumdatafiledefine.h
 * 
 * 初始版本：1.0
 * 作者：洪澄
 * 创建日期：2019/11/07
 * 摘要：图谱数据文件定义
 * 当前版本：1.0
 */

#pragma once

#include <QString>
#include "dataspecification_def.h"

namespace DataSpecificationGW
{
    struct SpectrumDataFileHead
    {
        qint32 iFileLength;                 // 文件长度
        QString qstrVersion;                // 版本信息
        QString qstrGenerationTime;         // 生成时间
        QString qstrStationName;            // 站点名称
        QString qstrStationCode;            // 站点编码
        Weather eWeather;                   // 天气情况
        float fTemperature;                 // 温度
        qint8 cHumidity;                    // 湿度
        QString qstrInstrumentManufacturer; // 仪器制造商
        QString qstrInstrumentModel;        // 仪器型号
        QString qstrInstrumentVersion;      // 仪器版本
        QString qstrInstrumentSerialNumber; // 仪器序列号
        float fSystemFrequency;             // 系统频率
        qint16 sSpectrumCount;              // 频谱计数
        QString qstrCompanyCode;            // 公司代码
        QString dataFileVersion;            // 数据文件版本

        SpectrumDataFileHead()
        {
            iFileLength = 0;
            qstrVersion = "1.1.0.0";
            eWeather = WEATHER_DEFAULT;
            fTemperature = 0.0;
            cHumidity = 0;
            fSystemFrequency = 50;
            sSpectrumCount = 0;
        }

        SpectrumDataFileHead& operator=(const SpectrumDataFileHead& stSpectrumDataFileHead)
        {
            this->iFileLength = stSpectrumDataFileHead.iFileLength;
            this->qstrVersion = stSpectrumDataFileHead.qstrVersion;
            this->qstrGenerationTime = stSpectrumDataFileHead.qstrGenerationTime;
            this->qstrStationName = stSpectrumDataFileHead.qstrStationName;
            this->qstrStationCode = stSpectrumDataFileHead.qstrStationCode;
            this->eWeather = stSpectrumDataFileHead.eWeather;
            this->fTemperature = stSpectrumDataFileHead.fTemperature;
            this->cHumidity = stSpectrumDataFileHead.cHumidity;
            this->qstrInstrumentManufacturer = stSpectrumDataFileHead.qstrInstrumentManufacturer;
            this->qstrInstrumentModel = stSpectrumDataFileHead.qstrInstrumentModel;
            this->qstrInstrumentVersion = stSpectrumDataFileHead.qstrInstrumentVersion;
            this->qstrInstrumentSerialNumber = stSpectrumDataFileHead.qstrInstrumentSerialNumber;
            this->fSystemFrequency = stSpectrumDataFileHead.fSystemFrequency;
            this->sSpectrumCount = stSpectrumDataFileHead.sSpectrumCount;
            this->qstrCompanyCode = stSpectrumDataFileHead.qstrCompanyCode;
            this->dataFileVersion = stSpectrumDataFileHead.dataFileVersion;
            return *this;
        }

        bool operator==(const SpectrumDataFileHead& stSpectrumDataFileHead) const
        {
            if (!(this->iFileLength == stSpectrumDataFileHead.iFileLength)) return false;
            if (!(this->qstrVersion == stSpectrumDataFileHead.qstrVersion)) return false;
            if (!(this->qstrGenerationTime == stSpectrumDataFileHead.qstrGenerationTime)) return false;
            if (!(this->qstrStationName == stSpectrumDataFileHead.qstrStationName)) return false;
            if (!(this->qstrStationCode == stSpectrumDataFileHead.qstrStationCode)) return false;
            if (!(this->eWeather == stSpectrumDataFileHead.eWeather)) return false;
            if (!(this->fTemperature == stSpectrumDataFileHead.fTemperature)) return false;
            if (!(this->cHumidity == stSpectrumDataFileHead.cHumidity)) return false;
            if (!(this->qstrInstrumentManufacturer == stSpectrumDataFileHead.qstrInstrumentManufacturer)) return false;
            if (!(this->qstrInstrumentModel == stSpectrumDataFileHead.qstrInstrumentModel)) return false;
            if (!(this->qstrInstrumentVersion == stSpectrumDataFileHead.qstrInstrumentVersion)) return false;
            if (!(this->qstrInstrumentSerialNumber == stSpectrumDataFileHead.qstrInstrumentSerialNumber)) return false;
            if (!(this->fSystemFrequency == stSpectrumDataFileHead.fSystemFrequency)) return false;
            if (!(this->sSpectrumCount == stSpectrumDataFileHead.sSpectrumCount)) return false;
            if (!(this->qstrCompanyCode == stSpectrumDataFileHead.qstrCompanyCode)) return false;
            if (!(this->dataFileVersion == stSpectrumDataFileHead.dataFileVersion)) return false;
            return true;
        }
    };
}
